package com.ruoyi.exam.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.exam.domain.ExamUserPracticeRecord;
import com.ruoyi.exam.vo.ExamUserPracticeRecordVo;
import com.ruoyi.exam.vo.MyWrongQuestionVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户刷题记录Mapper接口
 *
 * @author Tellsea
 * @date 2025-06-23
 */
public interface ExamUserPracticeRecordMapper extends BaseMapper<ExamUserPracticeRecord> {

    Page<ExamUserPracticeRecordVo> queryList(Page<?> page, @Param("entity") ExamUserPracticeRecordVo entity);

    List<ExamUserPracticeRecordVo> queryList(@Param("entity") ExamUserPracticeRecordVo entity);

    ExamUserPracticeRecordVo queryById(@Param("id") Long recordId);

    /**
     * 根据用户ID和题库ID查询练习记录
     *
     * @param userId 用户ID
     * @param bankId 题库ID
     * @return
     */
    List<ExamUserPracticeRecordVo> getByUserIdAndBankId(@Param("userId") Long userId, @Param("bankId") Long bankId);

    /**
     * 查询用户在指定题库中的错题列表
     *
     * @param userId 用户ID
     * @param bankId 题库ID
     * @return 错题列表
     */
    List<MyWrongQuestionVo> queryWrongQuestionsByUserIdAndBankId(@Param("userId") Long userId, @Param("bankId") Long bankId);

}
